package com.lvyq.myplayer.net.api

import com.lvyq.myplayer.model.index.IndexDailyBean
import com.lvyq.myplayer.model.index.IndexLastSongBean
import com.lvyq.myplayer.model.index.IndexPickPlayLstBean
import com.lvyq.myplayer.model.index.IndexHotSongBean
import com.lvyq.myplayer.model.index.IndexVideoBean
import com.lvyq.myplayer.model.ranking.RankingBean
import com.lvyq.myplayer.model.ranking.RankingItemBean
import com.lvyq.myplayer.model.singer.SingerInfoBean
import com.lvyq.myplayer.model.version.UpVersionBean
import com.lvyq.myplayer.util.URLProviderUtils
import retrofit2.Response
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * 文件描述：ApiService
 * 作者：lvyq
 * 创建时间：2025-03-28
 * 修改时间：2025-03-28
 */
interface IndexDailyPlayApiService {
    /**
     * 每日推荐
     */
    @GET("daily/getDaily")
    suspend fun list(): Response<IndexDailyBean>

    /**
     * 甄选歌单
     */
    @GET("playlist/getPickPlayLst")
    suspend fun getPickPlayLst():Response<IndexPickPlayLstBean>

    /**
     * 热门单曲
     */
    @GET("daily/getHeatSong")
    suspend fun getHeatSongLst():Response<IndexHotSongBean>

    /**
     * 最新单曲
     */
    @GET("song/getNewSong")
    suspend fun getLastSongLst():Response<IndexLastSongBean>

    /**
     * 歌手
     */
    @GET("singer/list")
    suspend fun getSingerLst(@Query("letterSort") letterSort:String?,@Query("type") type:Int?,@Query("sex") sex:Int?):Response<SingerInfoBean>

    /**
     * 推荐MV
     */
    @GET("video/getHotMvLst")
    suspend fun getHotMvLst():Response<IndexVideoBean>

    /**
     * 版本检测
     */
    @GET("song/checkVersion")
    suspend fun checkVersion(@Query("version") version: String): Response<UpVersionBean>

    /**
     * 排行榜詳情
     */
    @GET("item/list")
    suspend fun rankingItemList(@Query("rankingId") rankingId:Int):Response<RankingItemBean>
}

// Retrofit 实例
val retrofit = Retrofit.Builder()
    .baseUrl(URLProviderUtils.DoMain)
    .addConverterFactory(GsonConverterFactory.create())
    .build()

val indexDailyPlayApiService = retrofit.create(IndexDailyPlayApiService::class.java)

